package com.tom.school.controller;

import com.tom.school.model.SchoolCategory;
import com.tom.school.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@EnableAutoConfiguration
public class IndexController {
    @Resource
    private IndexService indexService;
    @RequestMapping("/index")
    public String index(){
        List<SchoolCategory> schoolCategories = indexService.getAllCategory();
        System.out.println(schoolCategories);
        return schoolCategories.toString();
      //  System.out.println(schoolCategories);
    }
}
